type calcFnType = (num1: number, num2: number) => number
function calc(calcFn: calcFnType) {
    const num1 = 100
    const num2 = 200
    console.log(calcFn(num1, num2));
}

function add(num1: number, num2: number) {
    return num1 + num2
}

function mul(num1: number, num2: number) {
    return num1 * num2
}

calc(add)
calc(mul)
calc(function (num1, num2) {// 类型推导出来的
    return num1 - num2
})
export { }